from django.db import models

# Create your models here.
class register(models.Model):
    user_name=models.CharField(verbose_name='用户名',max_length=11,default='a')
    password=models.CharField(verbose_name='密码',max_length=255)
    balance=models.DecimalField(verbose_name='余额',decimal_places=2,max_digits=8)
    flag=models.BooleanField(verbose_name='状态')
    create_time=models.DateTimeField(verbose_name='创建时间')
    update_time=models.DateTimeField(verbose_name='更新时间')
    
    class Meta:
        db_table = 'register'
        verbose_name = '注册信息'
        verbose_name_plural = verbose_name

class use_records(models.Model):
    plate_number=models.CharField(verbose_name='车牌号',max_length=255)
    in_time=models.DateTimeField(verbose_name='进入时间')
    out_time=models.DateTimeField(verbose_name='离开时间')
    park_id=models.IntegerField(verbose_name='停车场id')    
    fee=models.DecimalField(verbose_name='费用',decimal_places=2,max_digits=8)

    
    class Meta:
        db_table = 'use_records'
        verbose_name = '停车记录表'
        verbose_name_plural = verbose_name

class park_info(models.Model):
    park_id=models.IntegerField(verbose_name='停车场id')    
    park_name=models.CharField(verbose_name='停车场名',max_length=255)
    create_time=models.DateTimeField(verbose_name='创建时间')
    update_time=models.DateTimeField(verbose_name='更新时间')
    place=models.CharField(verbose_name='位置',max_length=255)
    capacity=models.IntegerField(verbose_name='容量')
    
    class Meta:
        db_table = 'park_info'
        verbose_name = '停车场信息'
        verbose_name_plural = verbose_name

class parking_lot(models.Model):
    lot_id = models.IntegerField(verbose_name='车位id')
    flag=models.BooleanField(verbose_name='状态', default=True)
    part=models.CharField(verbose_name='区域',max_length=11)
    create_time=models.DateTimeField(verbose_name='创建时间')
    update_time=models.DateTimeField(verbose_name='更新时间')
    park_id=models.IntegerField(verbose_name='停车场id')

    class Meta:
        db_table = 'parking_lot'
        verbose_name = '车位信息'
        verbose_name_plural = verbose_name